package org.jeecg.common.modules.dic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.modules.dic.entity.DicConstants;
import org.jeecg.common.modules.dic.mapper.DicConstantsMapper;
import org.jeecg.common.modules.dic.service.IDicConstantsService;
import org.springframework.stereotype.Service;

/**
 * @Description: dic_city
 * @Author: jeecg-boot
 * @Date:   2020-08-15
 * @Version: V1.0
 */
@Service
public class DicConstantsServiceImpl extends ServiceImpl<DicConstantsMapper, DicConstants> implements IDicConstantsService {


    @Override
    public String getByKey(String key) {
        DicConstants dicConstants = new DicConstants();
        dicConstants.setDicKey(key);
        LambdaQueryWrapper<DicConstants> query = new LambdaQueryWrapper<>(dicConstants);
        return getOne(query).getDicValue();
    }
}
